<%--
  Created by IntelliJ IDEA.
  User: 22531
  Date: 2021/6/14
  Time: 14:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">
<script type="text/javascript" src="/easyui/jquery.min.js"></script>
<script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
<script src="/easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<div class="easyui-panel" data-options="border:true," style="height: 80%;width: 60%;position: absolute;left: 20%;top: 10%;">
    <h2 style="text-align: center"> 修改密码</h2>
    <form id="ff" method="post" class="easyui-form">

        <div style="margin-bottom:10px;text-align: center" >
            <input class="easyui-textbox" name="old" style="width:200px" data-options="prompt:'请输入旧密码',required:true">
        </div>

        <div style="margin-bottom:10px;text-align: center" >
            <input class="easyui-textbox" name="newp" style="width:200px" data-options="prompt:'请输入新密码',required:true">
        </div>

        <div style="text-align:center;margin-bottom:30px">
            <input type="submit" value="修改" id="sub" class="easyui-linkbutton" style="width:80px;height:30px">
        </div>

    </form>
</div>

<script type="text/javascript">
  $(function() {
        $('#ff').form('submit',{
            url:'/stu/stuUpPass?id=${sessionScope.stu.id}',
            onSubmit:function(){
                return $(this).form('enableValidation').form('validate');
            },
            success:function (data){
                var data = eval('(' + data + ')');
                if(data.msg){
                    alert("更新密码成功");
                }else {
                    alert("更新密码失败："+data.error);
                }
            }
        });
    }
    )
</script>
</body>
</html>